package com.fudan.adse.service.impl;

import com.fudan.adse.domain.po.Room;
import com.fudan.adse.mbg.mapper.RoomMapper;
import com.fudan.adse.service.RoomService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * @author Jerry Zhang
 * create: 2022-11-26 16:19
 */
@Slf4j
@Service
public class RoomServiceImpl implements RoomService {
    @Autowired
    private RoomMapper roomMapper;
    @Override
    public void addRooms(List<Room> rooms) {
        rooms.forEach(room -> roomMapper.insert(room));
    }

    @Override
    public Room addRoom(Room room) {
        roomMapper.insert(room);
        return room;
    }
}
